package com.simtop.service.impl;

import com.simtop.mapper.UserRoleMapper;
import com.simtop.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName UserRoleServiceImpl
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-09-16 13:42
 **/
@Service
public class UserRoleServiceImpl implements UserRoleService {

    @Autowired
    private UserRoleMapper userRoleMapper;

    /**
     * 添加用户角色关联表
     * @param userId   用户id
     * @param roleIds  角色id数组
     * @return
     */
    @Override
    public boolean insertUserRole(Long userId, Integer[] roleIds) {
        return userRoleMapper.insertUserRole(userId,roleIds);
    }

    /**
     * 删除用户角色关联信息
     * @param userId   用户id
     * @return
     */
    @Override
    public boolean deleteUserRole(Long userId) {
        return userRoleMapper.deleteUserRole(userId);
    }
}
